<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<title>网页建设中</title>
	<link href="../../css/mui.min.css" rel="stylesheet" />
	<link rel="stylesheet" type="text/css" href="../../css/common.css"/>
	<link rel="stylesheet" type="text/css" href="../../css/active.edit.css"/>
	<link rel="stylesheet" type="text/css" href="../../css/contacts-edit.css"/>
</head>
<body>
	<header class="mui-bar mui-bar-nav">
		<a class="mui-icon mui-action-back mui-icon-back mui-pull-left"></a>
		<a class="mui-icon mui-pull-right" onclick="save()"><span class="my-h5" style="color: #FFFFFF;">保存</span></a>
		<h1 id="title-text" class="mui-title">添加流水项</h1>
	</header>
	<div class="mui-content">
		<form class="my-form">
			<ul class="mui-table-view" style="padding: 0; margin-top: 0;">
				<li class="mui-table-view-cell mui-media">
					<a href="javascript:;">
						<div class="mui-media-body">
							<span class="my-h3 mui-pull-left">货物编码</span>
							<span class="my-time-label mui-pull-right">
								<div class="mui-input-row mui-checkbox mui-checkbox-left">
									<select id="no" name="no" class="mui-select">
										<option value="">请选择</option>
									</select>
									<span class="mui-icon mui-icon-arrowright mui-pull-right"></span>
								</div>
							</span>
						</div>
					</a>
				</li>
				<li class="mui-table-view-cell mui-media">
					<a href="javascript:;">
						<div class="mui-media-body">
							<span class="my-h3 mui-pull-left">送货数量</span>
							<span class="my-time-label mui-pull-right">
								<div class="mui-input-row nobtn">
									<input id="count" type="text" class="mui-text" placeholder="送货数量"/>
								</div>
							</span>
						</div>
					</a>
				</li>
				<li class="mui-table-view-cell mui-media">
					<a href="javascript:;">
						<div class="mui-media-body">
							<span class="my-h3 mui-pull-left">实际入库</span>
							<span class="my-time-label mui-pull-right">
								<div class="mui-input-row nobtn">
									<input id="realCount" type="text" class="mui-text" placeholder="实际入库数量"/>
								</div>
							</span>
						</div>
					</a>
				</li>
				<li class="mui-table-view-cell mui-media">
					<a href="javascript:;">
						<div class="mui-media-body">
							<span class="my-h3 mui-pull-left">备注</span>
							<span class="my-time-label mui-pull-right">
								<div class="mui-input-row nobtn">
									<textarea id="memo" type="text" class="mui-text" placeholder="备注"></textarea>
								</div>
							</span>
						</div>
					</a>
				</li>
			</ul>
		</form>
	</div>
</body>
<script type="text/javascript" src="../../js/mui.min.js" ></script>
<script type="text/javascript" src="../../js/util/common.js" ></script>
<script type="text/javascript" src="../../js/jquery-3.1.1.min.js" ></script>
<script type="text/javascript" src="../../js/util/appWsUrl.js"></script>
<script type="text/javascript">
	//https://git.oschina.net/dasoft/szapp
	$(document).ready(function() {
		var url = UrlsParm.Goods.fetchAllGoods;
		console.log(url);
		ajax_get(url, {}, function(d){
			var list = d;
			for(var i=0; i<list.length; i++){
				var str = "<option value='"+list[i].no+"'>"+list[i].no+"</option>";
				$("#no").append(str);
			}
		});
	});
	function save() {
		var addForm = {
			id:guid(),
			no: $("#no").val(),
			name: "",
			count: $("#count").val(),
			realCount: $("#realCount").val(),
			memo: $("#memo").val(),
			createTime: (new Date()).getTime()
		}
		var url = UrlsParm.IO.addIo + encodeURIComponent(JSON.stringify(addForm));
		console.log(url);
		ajax_post(url, {}, function(data) {
			mui.toast("保存成功");
			setTimeout("mui.back()", 100);
		});
	}
</script>
</html>
